//package com.robot.orders.controller;
//
//import com.alibaba.fastjson.JSON;
//import com.robot.orders.pojo.SubOrders;
//import com.robot.orders.service.SubOrdersService;
//import entity.PageResult;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.domain.Page;
//import org.springframework.transaction.annotation.Transactional;
//import org.springframework.web.bind.annotation.*;
//
//import java.math.BigDecimal;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
///**
// * SubOrdersJsonController
// * 用于展示
// *
// * @author lin
// */
//@RestController
//@CrossOrigin
//@RequestMapping("/subOrders")
//public class SubOrdersJsonController {
//    @Autowired
//    private SubOrdersService subOrdersService;
//
//    private final Logger logger = LoggerFactory.getLogger(this.getClass());
//
//
//    /**
//     * 传入subOrders对象来增加subOrders
//     *
//     * @param subOrders
//     */
//    @RequestMapping(value = "third/addSubOrdersBySubOrders", method = RequestMethod.PUT, produces = "application/json; charset=utf-8")
//    @Transactional(rollbackFor = Exception.class)
//    public void thirdAddSubOrdersBySubOrders(@RequestBody String subOrders) {
//        subOrdersService.addSubOrders(JSON.parseObject(subOrders, SubOrders.class));
//    }
//
//    /**
//     * 传入subOrders对象来修改subOrders
//     *
//     * @param subOrders
//     */
//    @RequestMapping(value = "third/updateSubOrdersBySubOrders", method = RequestMethod.PUT, produces = "application/json; charset=utf-8")
//    @Transactional(rollbackFor = Exception.class)
//    public void thirdUpdateSubOrdersBySubOrders(@RequestBody String subOrders) {
//        subOrdersService.updateSubOrders(JSON.parseObject(subOrders, SubOrders.class));
//    }
//
//
//    /**
//     * 分页+多条件查询SubOrders
//     *
//     * @param searchMap 查询条件封装
//     * @param page      页码
//     * @param size      页大小
//     * @return 分页结果
//     */
//    @RequestMapping(value = "third/findSubOrdersBySearch/{page}/{size}", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersBySearch(@RequestBody Map searchMap, @PathVariable int page, @PathVariable int size) {
//        Page<SubOrders> pageList = subOrdersService.findSearch(searchMap, page, size);
//        return JSON.toJSONString(new PageResult<>(pageList.getTotalElements(), pageList.getContent()));
//    }
//
//    /**
//     * 根据id查询SubOrders
//     *
//     * @param id
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrderById/{id}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrderById(@PathVariable String id) {
//        return JSON.toJSONString(subOrdersService.findById(id));
//    }
//
//
//    /**
//     * 根据memberId查找SubOrders
//     *
//     * @param memberId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersByMemberId/{memberId}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersByMemberId(@PathVariable String memberId, @PathVariable int page, @PathVariable int size) {
//        Page<SubOrders> pageData = subOrdersService.findAllByMemberIdAndDeletedAtIsNullOrderByCreatedAtDesc(memberId, page, size);
//        return JSON.toJSONString(new PageResult<>(pageData.getTotalElements(), pageData.getContent()));
//    }
//
//    /**
//     * 根据memberID和evaluating查找SubOrders
//     *
//     * @param memberId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersByMemberIdAndEvaluating/{memberId}/{evaluating}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersByMemberIdAndEvaluating(@PathVariable String memberId, @PathVariable String evaluating, @PathVariable int page, @PathVariable int size) {
//        Page<SubOrders> pageData = subOrdersService.findAllByMemberIdAndEvaluatingAndDeletedAtIsNullOrderByCreatedAtDesc(memberId, evaluating, page, size);
//        return JSON.toJSONString(new PageResult<>(pageData.getTotalElements(), pageData.getContent()));
//    }
//
//    /**
//     * 根据memberID和status查找SubOrders
//     *
//     * @param memberId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersByMemberIdAndStatus/{memberId}/{status}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersByMemberIdAndStatus(@PathVariable String memberId, @PathVariable String status, @PathVariable int page, @PathVariable int size) {
//        Page<SubOrders> pageData = subOrdersService.findAllByMemberIdAndStatusAndDeletedAtIsNullOrderByCreatedAtDesc(memberId, status, page, size);
//        return JSON.toJSONString(new PageResult<>(pageData.getTotalElements(), pageData.getContent()));
//    }
//
//    /**
//     * 根据memberId和id查询SubOrders
//     *
//     * @param id
//     * @param memberId
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrderByMemberId/{id}/{memberId}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrderByIdAndMemberId(@PathVariable String id, @PathVariable String memberId) {
//        return JSON.toJSONString(subOrdersService.findByIdAndMemberId(id, memberId));
//    }
//
//    /**
//     * 根据memberId查找会员累计支付成功的订单数
//     *
//     * @param memberId
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrderCountByMemberId/{memberId}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrderCountByMemberId(@PathVariable String memberId) {
//        return JSON.toJSONString(subOrdersService.findCountByMemberId(memberId));
//    }
//
//    /**
//     * 根据memberId查找会员累计消费金额
//     *
//     * @param memberId
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrderPayAmountByMemberId/{memberId}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrderPayAmountByMemberId(@PathVariable String memberId) {
//        return JSON.toJSONString(subOrdersService.findPayAmountByMemberId(memberId));
//    }
//
//    /**
//     * 根据memberId和storeId查找会员累计消费金额
//     *
//     * @param memberId
//     * @param storeId
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrderPayAmountByMemberIdAndStoreId/{memberId}/{storeId}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrderPayAmountByMemberIdAndStoreId(@PathVariable String memberId, @PathVariable String storeId) {
//        return JSON.toJSONString(subOrdersService.findPayAmountByMemberIdAndStoreId(memberId, storeId));
//    }
//
//    /**
//     * 根据memberID查找会员累计节省金额
//     *
//     * @param memberId
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrderDiscountAmountByMemberId/{memberId}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrderDiscountAmountByMemberId(@PathVariable String memberId) {
//        return JSON.toJSONString(subOrdersService.findDiscountAmountByMemberId(memberId));
//    }
//
//
//    /**
//     * 根据storeId查找SubOrders
//     *
//     * @param storeId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersByStoreId/{storeId}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersByStoreId(@PathVariable String storeId, @PathVariable int page, @PathVariable int size) {
//        Page<SubOrders> pageData = subOrdersService.findAllByStoreIdAndDeletedAtIsNullOrderByCreatedAtDesc(storeId, page, size);
//        return JSON.toJSONString(new PageResult<>(pageData.getTotalElements(), pageData.getContent()));
//    }
//
//    /**
//     * 根据storeId,memberId和status查找SubOrders
//     *
//     * @param memberId
//     * @param storeId
//     * @param status
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersByMemberIdAndStoreIdAndStatus/{memberId}/{storeId}/{status}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersByMemberIdAndStoreIdAndStatus(@PathVariable String memberId, @PathVariable String storeId, @PathVariable String status, @PathVariable int page, @PathVariable int size) {
//        Page<SubOrders> pageData = subOrdersService.findAllByMemberIdAndStoreIdAndStatusAndDeletedAtIsNullOrderByCreatedAtDesc(memberId, storeId, status, page, size);
//        return JSON.toJSONString(new PageResult<>(pageData.getTotalElements(), pageData.getContent()));
//    }
//
//    /**
//     * 根据storeId查找本月累计支付成功的订单数
//     *
//     * @param storeId
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrderThisMonthCountByStoreId/{storeId}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrderThisMonthCountByStoreId(@PathVariable String storeId) {
//        return JSON.toJSONString(subOrdersService.findThisMonthCountByStoreId(storeId));
//    }
//
//    /**
//     * 根据storeId查找累计消费金额
//     *
//     * @param storeId
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrderPayAmountByStoreId/{storeId}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrderPayAmountByStoreId(@PathVariable String storeId) {
//        return JSON.toJSONString(subOrdersService.findPayAmountByStoreId(storeId));
//    }
//
//    /**
//     * 根据storeId查找今天订单
//     *
//     * @param storeId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersByStoreIdAndToday/{storeId}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersByStoreIdAndToday(@PathVariable String storeId, @PathVariable int page, @PathVariable int size) {
//        return JSON.toJSONString(findAllByStoreIdAndToday(storeId, page, size));
//    }
//
//    /**
//     * 根据storeId查找昨天订单
//     *
//     * @param storeId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersByStoreIdAndYesterday/{storeId}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersByStoreIdAndYesterday(@PathVariable String storeId, @PathVariable int page, @PathVariable int size) {
//        return JSON.toJSONString(findAllByStoreIdAndYesterday(storeId, page, size));
//    }
//
//    /**
//     * 根据storeId查找最近7日订单
//     *
//     * @param storeId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersByStoreIdAndWeek/{storeId}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersByStoreIdAndWeek(@PathVariable String storeId, @PathVariable int page, @PathVariable int size) {
//        return JSON.toJSONString(findAllByStoreIdAndWeek(storeId, page, size));
//    }
//
//    /**
//     * 根据storeId查找总订单
//     *
//     * @param storeId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersByStoreIdAndTotal/{storeId}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersByStoreIdAndTotal(@PathVariable String storeId, @PathVariable int page, @PathVariable int size) {
//        return JSON.toJSONString(findAllByStoreIdAndTotal(storeId, page, size));
//    }
//
//    /**
//     * 根据storeId查找昨天订单数和收益
//     *
//     * @param storeId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersCountByStoreIdAndYesterday/{storeId}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersCountByStoreIdAndYesterday(@PathVariable String storeId, @PathVariable int page, @PathVariable int size) {
//        PageResult<SubOrders> data = findAllByStoreIdAndYesterday(storeId, page, size);
//        BigDecimal payAmount = BigDecimal.ZERO;
//        for (SubOrders subOrders : data.getRows()) {
//            payAmount = payAmount.add(subOrders.getPayAmount());
//        }
//        HashMap<String, Object> map = new HashMap<>(2);
//        map.put("total", data.getTotal());
//        map.put("payAmount", payAmount);
//        logger.info("orders根据storeId查找昨天订单数和收益" + map);
//        return JSON.toJSONString(map);
//    }
//
//
//    /**
//     * 根据storeId查找最近7日订单数和收益
//     *
//     * @param storeId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersCountByStoreIdAndWeek/{storeId}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersCountByStoreIdAndWeek(@PathVariable String storeId, @PathVariable int page, @PathVariable int size) {
//        PageResult<SubOrders> data = findAllByStoreIdAndWeek(storeId, page, size);
//        BigDecimal payAmount = BigDecimal.ZERO;
//        for (SubOrders subOrders : data.getRows()) {
//            payAmount = payAmount.add(subOrders.getPayAmount());
//        }
//        HashMap<String, Object> map = new HashMap<>(2);
//        map.put("total", data.getTotal());
//        map.put("payAmount", payAmount);
//        logger.info("orders根据storeId查找最近7日订单数和收益" + map);
//        return JSON.toJSONString(map);
//    }
//
//    /**
//     * 根据storeId查找总订单数和收益
//     *
//     * @param storeId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersCountByStoreIdAndTotal/{storeId}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersCountByStoreIdAndTotal(@PathVariable String storeId, @PathVariable int page, @PathVariable int size) {
//        PageResult<SubOrders> data = findAllByStoreIdAndTotal(storeId, page, size);
//        BigDecimal payAmount = BigDecimal.ZERO;
//        for (SubOrders subOrders : data.getRows()) {
//            payAmount = payAmount.add(subOrders.getPayAmount());
//        }
//        HashMap<String, Object> map = new HashMap<>(2);
//        map.put("total", data.getTotal());
//        map.put("payAmount", payAmount);
//        logger.info("orders根据storeId查找总订单数和收益" + map);
//        return JSON.toJSONString(map);
//    }
//
//    /**
//     * 根据storeId查找今天订单
//     *
//     * @param storeId
//     * @param page
//     * @param size
//     * @return
//     */
//    public PageResult<SubOrders> findAllByStoreIdAndToday(String storeId, int page, int size) {
//        Page<SubOrders> pageData = subOrdersService.findAllByStoreIdAndToday(storeId, page, size);
//        PageResult<SubOrders> ordersPageResult = new PageResult<>(pageData.getTotalElements(), pageData.getContent());
//        return ordersPageResult;
//    }
//
//    /**
//     * 根据storeId查找昨天订单
//     *
//     * @param storeId
//     * @param page
//     * @param size
//     * @return
//     */
//    public PageResult<SubOrders> findAllByStoreIdAndYesterday(String storeId, int page, int size) {
//        Page<SubOrders> pageData = subOrdersService.findAllByStoreIdAndYesterday(storeId, page, size);
//        PageResult<SubOrders> ordersPageResult = new PageResult<>(pageData.getTotalElements(), pageData.getContent());
//        return ordersPageResult;
//    }
//
//    /**
//     * 根据storeId查找最近7日订单
//     *
//     * @param storeId
//     * @param page
//     * @param size
//     * @return
//     */
//    public PageResult<SubOrders> findAllByStoreIdAndWeek(String storeId, int page, int size) {
//        Page<SubOrders> pageData = subOrdersService.findAllByStoreIdAndWeek(storeId, page, size);
//        PageResult<SubOrders> ordersPageResult = new PageResult<>(pageData.getTotalElements(), pageData.getContent());
//        return ordersPageResult;
//    }
//
//    /**
//     * 根据storeId查找总订单
//     *
//     * @param storeId
//     * @param page
//     * @param size
//     * @return
//     */
//    public PageResult<SubOrders> findAllByStoreIdAndTotal(String storeId, int page, int size) {
//        Page<SubOrders> pageData = subOrdersService.findAllByStoreIdAndTotal(storeId, page, size);
//        PageResult<SubOrders> ordersPageResult = new PageResult<>(pageData.getTotalElements(), pageData.getContent());
//        return ordersPageResult;
//    }
//
//
//    /**
//     * 根据agentId查找今天订单
//     *
//     * @param agentId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersByAgentIdAndToday/{agentId}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersByAgentIdAndToday(@PathVariable String agentId, @PathVariable int page, @PathVariable int size) {
//        return JSON.toJSONString(findAllByAgentIdAndToday(agentId, page, size));
//    }
//
//    /**
//     * 根据agentId查找昨天订单
//     *
//     * @param agentId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersByAgentIdAndYesterday/{agentId}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersByAgentIdAndYesterday(@PathVariable String agentId, @PathVariable int page, @PathVariable int size) {
//        return JSON.toJSONString(findAllByAgentIdAndYesterday(agentId, page, size));
//    }
//
//    /**
//     * 根据agentId查找最近7日订单
//     *
//     * @param agentId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersByAgentIdAndWeek/{agentId}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersByAgentIdAndWeek(@PathVariable String agentId, @PathVariable int page, @PathVariable int size) {
//        return JSON.toJSONString(findAllByAgentIdAndWeek(agentId, page, size));
//    }
//
//    /**
//     * 根据agentId查找总订单
//     *
//     * @param agentId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersByAgentIdAndTotal/{agentId}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersByAgentIdAndTotal(@PathVariable String agentId, @PathVariable int page, @PathVariable int size) {
//        return JSON.toJSONString(findAllByAgentIdAndTotal(agentId, page, size));
//    }
//
//    /**
//     * 根据agentId查找昨天订单数和收益
//     *
//     * @param agentId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersCountByAgentIdAndYesterday/{agentId}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersCountByAgentIdAndYesterday(@PathVariable String agentId, @PathVariable int page, @PathVariable int size) {
//        PageResult<SubOrders> data = findAllByAgentIdAndYesterday(agentId, page, size);
//        BigDecimal agentRevenue = BigDecimal.ZERO;
//        for (SubOrders subOrder : data.getRows()) {
//            agentRevenue = agentRevenue.add(subOrder.getAgentRevenue());
//        }
//        HashMap<String, Object> map = new HashMap<>(2);
//        map.put("total", data.getTotal());
//        map.put("agentRevenue", agentRevenue);
//        return JSON.toJSONString(map);
//    }
//
//
//    /**
//     * 根据agentId查找最近7日订单数和收益
//     *
//     * @param agentId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersCountByAgentIdAndWeek/{agentId}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersCountByAgentIdAndWeek(@PathVariable String agentId, @PathVariable int page, @PathVariable int size) {
//        PageResult<SubOrders> data = findAllByAgentIdAndWeek(agentId, page, size);
//        BigDecimal agentRevenue = BigDecimal.ZERO;
//        for (SubOrders subOrder : data.getRows()) {
//            agentRevenue = agentRevenue.add(subOrder.getAgentRevenue());
//        }
//        HashMap<String, Object> map = new HashMap<>(2);
//        map.put("total", data.getTotal());
//        map.put("agentRevenue", agentRevenue);
//        logger.info("orders根据agentId查找最近7日订单数和收益" + map);
//        return JSON.toJSONString(map);
//    }
//
//    /**
//     * 根据agentId查找总订单数和收益
//     *
//     * @param agentId
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersCountByAgentIdAndTotal/{agentId}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersCountByAgentIdAndTotal(@PathVariable String agentId, @PathVariable int page, @PathVariable int size) {
//        PageResult<SubOrders> data = findAllByAgentIdAndTotal(agentId, page, size);
//        BigDecimal agentRevenue = BigDecimal.ZERO;
//        for (SubOrders subOrder : data.getRows()) {
//            agentRevenue = agentRevenue.add(subOrder.getAgentRevenue());
//        }
//        HashMap<String, Object> map = new HashMap<>(2);
//        map.put("total", data.getTotal());
//        map.put("agentRevenue", agentRevenue);
//        return JSON.toJSONString(map);
//    }
//
//    /**
//     * 根据agentId和createdAt查找总订单
//     *
//     * @param agentId
//     * @param createdAt
//     * @param page
//     * @param size
//     * @return
//     */
//    @RequestMapping(value = "third/findSubOrdersByAgentIdAndCreatedAt/{agentId}/{createdAt}/{page}/{size}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
//    public String thirdFindSubOrdersByAgentIdAndCreatedAt(@PathVariable String agentId, @PathVariable String createdAt, @PathVariable int page, @PathVariable int size) {
//        List<SubOrders> subOrders = subOrdersService.findAllByAgentIdAndCreatedAt(agentId, createdAt, page, size);
//        return JSON.toJSONString(subOrders);
//
//    }
//
//    /**
//     * 根据agentId查找今天订单
//     *
//     * @param agentId
//     * @param page
//     * @param size
//     * @return
//     */
//    public PageResult<SubOrders> findAllByAgentIdAndToday(String agentId, int page, int size) {
//        Page<SubOrders> pageData = subOrdersService.findAllByAgentIdAndToday(agentId, page, size);
//        PageResult<SubOrders> ordersPageResult = new PageResult<>(pageData.getTotalElements(), pageData.getContent());
//        return ordersPageResult;
//    }
//
//    /**
//     * 根据agentId查找昨天订单
//     *
//     * @param agentId
//     * @param page
//     * @param size
//     * @return
//     */
//    public PageResult<SubOrders> findAllByAgentIdAndYesterday(String agentId, int page, int size) {
//        Page<SubOrders> pageData = subOrdersService.findAllByAgentIdAndYesterday(agentId, page, size);
//        PageResult<SubOrders> ordersPageResult = new PageResult<>(pageData.getTotalElements(), pageData.getContent());
//        return ordersPageResult;
//    }
//
//    /**
//     * 根据agentId查找最近7日订单
//     *
//     * @param agentId
//     * @param page
//     * @param size
//     * @return
//     */
//    public PageResult<SubOrders> findAllByAgentIdAndWeek(String agentId, int page, int size) {
//        Page<SubOrders> pageData = subOrdersService.findAllByAgentIdAndWeek(agentId, page, size);
//        PageResult<SubOrders> ordersPageResult = new PageResult<>(pageData.getTotalElements(), pageData.getContent());
//        return ordersPageResult;
//    }
//
//    /**
//     * 根据agentId查找总订单
//     *
//     * @param agentId
//     * @param page
//     * @param size
//     * @return
//     */
//    public PageResult<SubOrders> findAllByAgentIdAndTotal(String agentId, int page, int size) {
//        Page<SubOrders> pageData = subOrdersService.findAllByAgentIdAndTotal(agentId, page, size);
//        PageResult<SubOrders> ordersPageResult = new PageResult<>(pageData.getTotalElements(), pageData.getContent());
//        return ordersPageResult;
//    }
//}
